function yesOperator(){
    console.log("====yesOperator=====");
    var retValue=selectData();
    return retValue;
}
function selectData(){
    var selection = $("#setClassifyTable").jqxTreeGrid('getSelection');

    var len = selection.length;

    if (len == 0) {
        //未选中数据提示框
        layer.msg('请选择数据',  {time:2500});

    } else {

        var rows= $("#setClassifyTable").jqxTreeGrid('getSelection');
        var rowIds = [];
        var ret={};
        return rows[0];
    }
}

$(function () {
    //tree
    var DataSource = [];
    $$.ajax({
        url: "/rest/IotCalcCatalogBusiness/listAllSort",
        async: false,
        data: {
            menuCode: ""
        },
        success: function (data) {
            //console.log("listByMenuId:"+JSON.stringify(data));
            DataSource = data;
        }
    });
    var source ={
        dataType: "json",
        dataFields: [{
            name: "stockName",
            type: "string",

        }, {
            name: "DataSourceID",
            type: "string",

        },{
            name: 'children',
            type: 'array'
        },{
            name: 'expanded',
            type: 'bool'
        }],
        hierarchy: {
            root: 'children'
        },
        id: 'DataSourceID',
        localData: DataSource
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    // create Tree Grid
    $("#setClassifyTable").jqxTreeGrid({
        source: dataAdapter,
        width: '100%',
        altRows: true,
        selectionMode: "singleRow",
        height: 380,
        theme: 'bootstrap',
        showToolbar: false,
        enableHover: true,
        columns: [{
            text: "分类",
            align: "center",
            dataField: "stockName",
        }]
    });
    //点击每行获取值
    $("#setClassifyTable").on('rowSelect', function (event) {
        var args = event.args;
        var row = args.row;
        console.log("The row is that you selected ");
    });
})




